export default defineEventHandler(event => {
	const userAgent = getHeader(event, 'user-agent') || '';

	// 设备检测逻辑
	const isMobile = /mobile|android|iphone|ipad|phone/i.test(userAgent.toLowerCase());
	const deviceType = isMobile ? 'mobile' : 'desktop';

	// 设置到上下文
	event.context.deviceType = deviceType;
	event.context.isMobile = isMobile;
	event.context.isDesktop = !isMobile;
});
